import { deviceList } from "../enum/interactive.enum"
import funcUtil from "../utils/func.util"
import transitionTypeEnum from "../enum/transitionType.enum"
const switchConfig = {
    flipDownload: funcUtil.getUrlParams("flipDownload", !0),
    flipUpload: funcUtil.getUrlParams("flipUpload", !0),
    debugLOD: funcUtil.getUrlParams("debuglod", !1),
    debugRttQuality: funcUtil.getUrlParams("debugQuality", !1),
    debugRttScores: funcUtil.getUrlParams("debugScores", !1),
    debugRttClear: funcUtil.getUrlParams("debuglodrtt", !0),
    debugPauseTexStream: funcUtil.getUrlParams("textureStreamPause", !1),
    highQualityDam: funcUtil.getUrlParams("highqdam", !1)
  },
  tileSet = funcUtil.getUrlParams("tileset", "mesh_tiles"),
  tilesRoot = funcUtil.getUrlParams("tilesroot", "tileset.json"),
  meshKey = "features/mesh-rendering",
  wireKey = "wireframeEnabled",
  tiledKey = "features/tiled_mesh",
  fadeConfig = {
    FADE_OPAQUE: 1,
    FADE_ABOVE: 0.024,
    FADE_BELOW: 0.1,
    FADE_CLICKABLE_THRESHOLD: 0.025,
    FADE_IN_VALUE: 0.08,
    FADE_DEPTH_WRITE_THRESHOLD: funcUtil.getUrlParams("chunkDepthWrite", 0.5),
    FADE_IN_END_ANGLE: 45,
    FADE_IN_START_ANGLE: 22,
    FADE_IN_HOVER_BOOST_VALUE: 0.2,
    FADE_BELOW_START: 0,
    FADE_BELOW_MULT: 1,
    DISCARD_FOCAL_MULTI: 0.125
  }
const DEFAULT_TRANSITION_TIME = 1000
const TRANSITION_DISTANCE_MULTIPLIER = 166
const transitionConfig = Object.freeze({
  camera: {
    transitionBlackoutTime: 300,
    transitionFadeTime: 800,
    baseTransitionTime: funcUtil.getUrlParams("btt", 200),
    transitionSpeed: funcUtil.getUrlParams("tsp", 3)
  }
})
const tourAniType = {
  [deviceList.Desktop]: transitionTypeEnum.Interpolate,
  [deviceList.Mobile]: transitionTypeEnum.Interpolate,
  [deviceList.VrOrientOnly]: transitionTypeEnum.FadeToBlack,
  [deviceList.VrWithController]: transitionTypeEnum.FadeToBlack,
  [deviceList.VrWithTrackedController]: transitionTypeEnum.FadeToBlack
}

const labelConfig = {
  FADE_DURATION: 300,
  LABEL_HIDDEN_OPACITY: 0.15,
  DEPTH_WRITE_THRESHOD: 0.15,
  ALIGN_LABELS: !1,
  LABEL_SIZING: 0.14,
  LABEL_NDC_SCALEFACTOR: 0.5,
  LABEL_ASPECT_SCALEFACTOR: 0.035,
  OFFSET_TOWARDS_CAMERA: 0.25,
  HIDE_LABELS: !1
}
const lineConfig = {
  dottedLineDefault: 2,
  lineDefault: 6,
  lineSelected: 6,
  endpointDefault: 2.5,
  endpointSelected: 3.75
}
const lineMinScale = 0.01
const lineMaxScale = 5

const tileConfig = Object.freeze({
  overlayStyle: funcUtil.getUrlParams("tileoverlay", 0),
  uploadIntervalDelay: funcUtil.getUrlParams("tileupdelay", 50),
  highResUploadsPerFrame: funcUtil.getUrlParams("maxnbtpf", 2),
  maxHighResUploadsPerFrame: 100,
  loadIndicatorDelay: 300,
  uploadsPerFrame: funcUtil.getUrlParams("maxbtpf", 6),
  maxUploadsPerFrame: 100,
  windowHeightHighQualityThreshold: 800,
  windowHeightHighQualityThresholdOverride: funcUtil.getUrlParams("threshold2k", void 0),
  concurrentDownloads: funcUtil.getUrlParams("tileconc", 3),
  maxConcurrentDownloads: 12,
  navigation: { directionFactor: 10, distanceFactor: -1 }
})
const NavigationConfig = { longerTransitionMaxDist: 10, TRANSITION_TIME_DH: 650 }

const BasePlaneSize = 1
const PlaneBufferGeometryConfg = Object.freeze({
  anchor: { size: 0.1 },
  stem: {
    length: 0.23,
    width: 1,
    opacity: 1,
    transparent: !0,
    color: "white",
    alphaTest: 0.05
  },
  pinHeadMesh: {
    scale: {
      nearBound: 1.5,
      farBound: 4.8,
      maxSize: 80,
      minSize: 40,
      baseViewportSize: 800,
      responsiveness: 100
    }
  }
})

export default {
  switchConfig,
  tileSet,
  tilesRoot,
  meshKey,
  wireKey,
  tiledKey,
  fadeConfig,
  DEFAULT_TRANSITION_TIME,
  TRANSITION_DISTANCE_MULTIPLIER,
  transitionConfig,
  tourAniType,
  labelConfig,
  lineConfig,
  lineMinScale,
  lineMaxScale,
  tileConfig,
  NavigationConfig,
  BasePlaneSize,
  PlaneBufferGeometryConfg
}
